Auto merge of #3527 - nikomatsakis:master, r=alexcrichton
authorbors <bors@rust-lang.org>
Thu, 12 Jan 2017 00:45:23 +0000 (00:45 +0000)
committerbors <bors@rust-lang.org>
Thu, 12 Jan 2017 00:45:23 +0000 (00:45 +0000)
commitd12cc03cf3b144bc7f13707f40d29edb79dc259d
tree1e9cf0967cbbbf1de3e32cd2141ebaeb01b66222
parent6dd4ff0f5b59fff524762c4a7b65882adda713c0
parent30e91b573b08097ef6f735a7a5df9c035a3ace10
Auto merge of #3527 - nikomatsakis:master, r=alexcrichton

check for `CARGO_INCREMENTAL` and pass `-Zincremental` if present

Per the discussion on IRC, this adds a very simple way for cargo users to opt into incremental compilation by setting the `CARGO_INCREMENTAL` environment variable (i.e., `CARGO_INCREMENTAL=1 cargo build`). This will result in incremental data being stored into the `target/incremental` directory. Since it supplies `-Z`, this option is only intended for use on nightly compilers, though cargo makes no effort to check.

The plan is to keep incremental compilation optional until we are feeling more confident it's not going to cause problems for people. At that point, it should become part of the compilation profile. It will be the default when building in debug builds, and opt-in for release builds.